package com.wuhanpe.leafid.model

import java.util.concurrent.atomic.AtomicLong
import kotlin.concurrent.Volatile

/**
 * @author zooy
 * @since 2025/9/12-16:26
 */
class Segment constructor(val buffer: SegmentBuffer) {

    var value: AtomicLong = AtomicLong(0)

    @Volatile
    var max: Long = 0

    @Volatile
    var step: Int = 0

    fun getIdle(): Long {
        return this.max - this.value.get()
    }

}
